//
//  LBStatusBottomView.swift
//  LBNewWeiBo
//
//  Created by bin on 15/11/1.
//  Copyright © 2015年 bin. All rights reserved.
//

import UIKit

/// 微博的底部视图
class LBStatusBottomView: UIView {

    
    //MARK: - 构造函数
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        backgroundColor = UIColor(white: 0.96, alpha: 0.8)
//        backgroundColor = UIColor.clearColor()
        // 准备UI
        prepareUI()
    }

    func prepareUI() {
        
        // 添加子控件
        addSubview(transmitBtn) // 转发
        addSubview(commentBtn) // 评论
        addSubview(goodBtn) // 赞
        addSubview(separetorViewOne)
        addSubview(separetorViewTwo)
        // 设置子控件的约束
        /// 平铺所有子控件
        self.ff_HorizontalTile([transmitBtn, commentBtn, goodBtn], insets: UIEdgeInsetsZero)
        // 添加1根分割线的约束
        separetorViewOne.ff_AlignVertical(type: ff_AlignType.CenterRight, referView: transmitBtn, size: nil)
        // 添加第二根分割线的约束
        separetorViewTwo.ff_AlignVertical(type: ff_AlignType.CenterRight, referView: commentBtn, size: nil)

    }
    
    
    //MARK: - 懒加载
    /// 转发按钮
    lazy var transmitBtn: UIButton = UIButton(imageName: "timeline_icon_retweet", title: "转发", fontsize: 12, color: UIColor.darkGrayColor())
    
    /// 评论按钮
     lazy var commentBtn: UIButton = UIButton(imageName: "timeline_icon_comment", title: "评论", fontsize: 12, color: UIColor.darkGrayColor())
    
    /// 赞按钮
    lazy var goodBtn: UIButton = UIButton(imageName: "timeline_icon_unlike", title: "赞", fontsize: 12, color: UIColor.grayColor())
    /// 按钮之间的1 分割线
    lazy var separetorViewOne: UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line_highlighted"))
    ///2号分割线
    lazy var separetorViewTwo: UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line_highlighted"))
    
}
